-
Notifications
You must be signed in to change notification settings - Fork 827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow CW->ERC pointers to be called through wasmd precompile #1785
Conversation
181e4fb
to
ab68883
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1785 +/- ##
==========================================
- Coverage 61.64% 60.81% -0.83%
==========================================
Files 365 380 +15
Lines 26178 28021 +1843
==========================================
+ Hits 16138 17042 +904
- Misses 8967 9825 +858
- Partials 1073 1154 +81
|
de1c3bf
to
02da59a
Compare
@@ -118,6 +118,23 @@ func (k *Keeper) CallEVM(ctx sdk.Context, from common.Address, to *common.Addres | |||
if res.Err != nil { | |||
vmErr = res.Err.Error() | |||
} | |||
existingReceipt, err := k.GetTransientReceipt(ctx, ctx.TxSum()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this logic related to the wasmd precompile stuff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah it's to merge with the temp receipts created in the CW->EVM hop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall LGTM
02da59a
to
824831c
Compare
824831c
to
4ee4fc2
Compare
* main: Add more DEX dapp tests (#1809) Add basic LST integration tests (#1814) Allow CW->ERC pointers to be called through wasmd precompile (#1785) Bump nonce even if tx fails (#1778) Fix docker setup for local cluster (#1806) Tune Configs (#1813) V5.7.5 release (#1805) Evidence Max Bytes Update (#1812) Add dApp Tests (#1802) [EVM] Tune configs (#1800) Revert dex removal (#1801) Do not charge gas for feecollector address query (#1795)
Apologies for being late to this. I received no communication that this was the implemented solution until now. What exactly does this protect against? I can deploy an "ERC-20 token" which can still embed a nasty payload if the "transfer" function was called with specific sender and use the address and amount params as commands for the malicious code. This solution needlessly impedes the ability for CW contracts to call the ERC-20 tokens directly without the use of a pointer with no security benefit. |
Describe your changes and provide context
For EVM transactions that call the wasmd precompile (
0x1002
) directly, we want to allow the destination CW contract to be call back to some EVM contracts (e.g. ERC20) at most once (right now none is allowed). This PR leverages a new flag set onsdk.Context
to track whether a CW->EVM call is eligible for this special case. Note that this only applies to the top level - something like precompile->CW->precompile->CW is still not allowed.Testing performed to validate your change
hardhat test